﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Channel.aspx.cs" Inherits="_2011DBProject.Channel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link rel=StyleSheet HREF='design1.css' type='text/css'>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>새벽 골프</title>
       <style type="text/css">
    body
    {
    	background-image:url('/image/background4.jpg')
    }
</style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <p align =left>
        <asp:Button ID="btnGoLogout" runat="server" onclick="btnGoLogout_onclick" 
            Text="☜ 로 그 아 웃" Width="150px" />
        <asp:Button ID="btnGoServer" runat="server" onclick="btnGoServer_onclick" 
            Text="☜ 서 버 선 택" Width="150px" />
        <asp:Button ID="btnGoCharacter" runat="server" onclick="btnGoCharacter_onclick" 
            Text="☜ 캐 릭 선 택" Width="150px" />
            <asp:DataList ID="DataList3" runat="server" DataKeyField="SERVER_NO" 
            DataSourceID="SqlDataSource1" Visible="False" Height="31px" Width="114px">

       <Itemtemplate>
           <asp:Label ID="lblDLServer" runat="server" Text='<%# Eval("SERVER_NAME") %>' />
                </ItemTemplate>

        </asp:DataList>
        </p>
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <asp:Label ID="lblServer" runat="server" Font-Bold="True" Font-Size="Large" 
            ForeColor="#FFFF99" Text="서버선택안됨"></asp:Label>서버의
        <asp:Label ID="lblCh" runat="server" Font-Bold="True" Font-Size="Large" 
            ForeColor="#FFFF99" Text="이름없음"></asp:Label>
        &nbsp;이(가) 접속하였습니다.<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT * FROM &quot;SERVER&quot; WHERE (&quot;SERVER_NO&quot; = :SERVER_NO)">
            <SelectParameters>
                <asp:SessionParameter Name="SERVER_NO" SessionField="SERVER" Type="Decimal" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <br />
    
        <asp:Label ID="lblgrade" runat="server" Text="Label" Visible="False"></asp:Label>
    
        <br />
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="채널 입장" 
            Visible="False" Height="44px" Width="550px" />
        <br />
        <br />
        <asp:GridView ID="gvChannel" runat="server" AutoGenerateColumns="False" 
            CellPadding="10" DataKeyNames="CHANNEL_NO,SERVER_NO" DataSourceID="sqldsChannel" 
            EmptyDataText="표시할 데이터 레코드가 없습니다." ForeColor="#333333" GridLines="None" 
            onselectedindexchanged="gvChannel_SelectedIndexChanged" 
            HorizontalAlign="Center">
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="CHANNEL_NO" HeaderText="번호" ReadOnly="True" 
                    SortExpression="CHANNEL_NO" />
                <asp:BoundField DataField="CHANNEL_NAME" HeaderText="채널명" 
                    SortExpression="CHANNEL_NAME" HeaderStyle-Width="112" />
                <asp:BoundField DataField="CHANNEL_STATUS" HeaderText="상태" 
                    SortExpression="CHANNEL_STATUS" HeaderStyle-Width="90"/>
                <asp:BoundField DataField="MAX" HeaderText="최대수용인원" SortExpression="MAX" />
                <asp:BoundField DataField="CURRENT_NO_MEMBERS" HeaderText="현재입장인원" 
                    SortExpression="CURRENT_NO_MEMBERS" />
                <asp:BoundField DataField="CHANNEL_CODE_CAT" HeaderText="CHANNEL_CODE_CAT" 
                    SortExpression="CHANNEL_CODE_CAT" Visible="False" />
                <asp:BoundField DataField="CHANNEL_CODE" HeaderText="CHANNEL_CODE" 
                    SortExpression="CHANNEL_CODE" Visible="False" />
            </Columns>
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <br />
        <br />
        <asp:SqlDataSource ID="sqldsChannel" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            DeleteCommand="DELETE FROM &quot;CHANNEL&quot; WHERE &quot;CHANNEL_NO&quot; = :CHANNEL_NO AND &quot;SERVER_NO&quot; = :SERVER_NO" 
            InsertCommand="INSERT INTO &quot;CHANNEL&quot; (&quot;CHANNEL_NO&quot;, &quot;CHANNEL_NAME&quot;, &quot;CHANNEL_STATUS&quot;, &quot;MAX&quot;, &quot;CURRENT_NO_MEMBERS&quot;, &quot;CHANNEL_CODE_CAT&quot;, &quot;CHANNEL_CODE&quot;, &quot;SERVER_NO&quot;) VALUES (:CHANNEL_NO, :CHANNEL_NAME, :CHANNEL_STATUS, :MAX, :CURRENT_NO_MEMBERS, :CHANNEL_CODE_CAT, :CHANNEL_CODE, :SERVER_NO)" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT CHANNEL_NO, CHANNEL_NAME, CHANNEL_STATUS, &quot;MAX&quot;, CURRENT_NO_MEMBERS, CHANNEL_CODE_CAT, CHANNEL_CODE, SERVER_NO FROM CHANNEL WHERE (SERVER_NO = :server)" 
            
            
            UpdateCommand="UPDATE &quot;CHANNEL&quot; SET &quot;CHANNEL_NAME&quot; = :CHANNEL_NAME, &quot;CHANNEL_STATUS&quot; = :CHANNEL_STATUS, &quot;MAX&quot; = :MAX, &quot;CURRENT_NO_MEMBERS&quot; = :CURRENT_NO_MEMBERS, &quot;CHANNEL_CODE_CAT&quot; = :CHANNEL_CODE_CAT, &quot;CHANNEL_CODE&quot; = :CHANNEL_CODE WHERE &quot;CHANNEL_NO&quot; = :CHANNEL_NO AND &quot;SERVER_NO&quot; = :SERVER_NO">
            <SelectParameters>
                <asp:SessionParameter Name="server" SessionField="SERVER" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="CHANNEL_NO" Type="Decimal" />
                <asp:Parameter Name="SERVER_NO" Type="Decimal" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="CHANNEL_NO" Type="Decimal" />
                <asp:Parameter Name="CHANNEL_NAME" Type="String" />
                <asp:Parameter Name="CHANNEL_STATUS" Type="Decimal" />
                <asp:Parameter Name="MAX" Type="Decimal" />
                <asp:Parameter Name="CURRENT_NO_MEMBERS" Type="Decimal" />
                <asp:Parameter Name="CHANNEL_CODE_CAT" Type="Decimal" />
                <asp:Parameter Name="CHANNEL_CODE" Type="Decimal" />
                <asp:Parameter Name="SERVER_NO" Type="Decimal" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="CHANNEL_NAME" Type="String" />
                <asp:Parameter Name="CHANNEL_STATUS" Type="Decimal" />
                <asp:Parameter Name="MAX" Type="Decimal" />
                <asp:Parameter Name="CURRENT_NO_MEMBERS" Type="Decimal" />
                <asp:Parameter Name="CHANNEL_CODE_CAT" Type="Decimal" />
                <asp:Parameter Name="CHANNEL_CODE" Type="Decimal" />
                <asp:Parameter Name="CHANNEL_NO" Type="Decimal" />
                <asp:Parameter Name="SERVER_NO" Type="Decimal" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <br />
   
        <br />
        <br />
        <br />
        <br />
        <br />
    
    </div>
    </form>
</body>
</html>
